<template>
	<view>
		<view>
				<view v-if="orderList.length!=0">
					<view v-for="(item) in orderList">
						<uni-list>
							<uni-list-item :title="item['ordertime']" :rightText="item['order_list'][0]['orderstate']"
								:note="item['shippingaddr']">
							</uni-list-item>
						</uni-list>
					</view>
				</view>
				<view v-else>他暂时没有订单~</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderList:[]
			}
		},
		methods: {
			
		},
		onLoad(option) {
			const eventChannel = this.getOpenerEventChannel();
			eventChannel.on('getCustomerOrderList',(data)=>{
				console.log(data)
				this.$myRequest({
					url: '/assets/get_order_list_by_custelenumber/',
					data: {
						'telenumber': data.telenumber
					}
				}).then(res => {
					console.log(res.data);
					this.orderList = res.data;
				})
			})
		}
	}
</script>

<style>

</style>
